<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<%
   String contextPath = request.getContextPath();
%>      
<script type="text/javascript">
$(function(){
	var count = 0;
	
	$('#confirmId').click(function(){
		var uid = $('#id').val();
		if(uid == ''){
			alert("아이디를 입력해주세요.");
			$('#id').focus();
			return;
		}
		$.getJSON('<%=contextPath%>/confirmId.do',
              							  {id:uid},
				  				    function(data){
			if(data.check == 'success'){
				count = 1; 
				$('#id_signed').html('사용가능한 아이디입니다.')
		           			   .css('color','blue');
			}else{
				count = 0;
				$('#id_signed').html('이미 등록된 아이디입니다.')
				               .css('color','red');
				$('#id').val('').focus();	
			}  	
		}); 
	}); 
		
	$('#insert_form').submit(function(event){
		if(count != 1){
			alert('아이디 중복는 체크 필수입니다.');
			$('#id').focus();
			return false;
		}
		
		alert('전송');
		//기본 이벤트 제거
		event.preventDefault();
		
	});
});

</script>

<div id="wrapper">
<div id="container_sub">
<div id="sub_page_bg4"></div>
<div id="content_list">
<div class="title">
	<div class="sub_title">
	
			<li>회원정보입력</li>
			<li class="stitle">회원정보를 입력해 주세요.</li>
		
	</div>
	<div class="navig">
		
		<li class='frst'><img src='../image/all/home_icon.png' align='absmiddle' width='13' height='13'> <a href='<%=contextPath%>/main/index.do'>HOME</a></li>
		<li>우리결혼할래요</li>
		<li>회원가입</li>
	</div>
	<!-- 입력폼 시작 -->
<form:form id="fregisterform" enctype="multipart/form-data" action="join.do" commandName="memberCommand">
<div class="tb_frm01 tb1_wrap">
<fieldset class="join_Fieldset">
	<legend class="hiddenL">온라인 회원 가입을 위한 정보입력</legend>
	<div style="margin:30px 0;" class="189">
	<h4 class="joinTxt-1">사이트 이용정보 입력</h4>
		<form:errors element="div"/>
		<div class="joinWrap">
			<div class="row">
			<form:errors element="div"/>
					<label for="name" class="joinLabel-1"><spring:message code="join.form.name"/></label>
					<form:input path="name" class="joinInput-1"/>
					<form:errors path="name"/>
			</div>
			<div class="row">
					<label for="id" class="joinLabel-1"><spring:message code="join.form.id"/></label>
               		<form:input path="id" />
              		<input type="button" value="ID중복체크" id="confirmId" >
              		<form:errors path="id"/>
               		<span id="id_signed"></span>
           	</div>	
           	<div class="row">
					<label for="password" class="joinLabel-1"><spring:message code="join.form.password"/></label>
					<form:password path="password"/>
					<form:errors path="password"/>
			</div>
			<div class="row">
					<label for="passwordconfirm" class="joinLabel-1"><spring:message code="join.form.passwordconfirm"/></label>
					<form:password path="passwordconfirm"/>
					<form:errors path="passwordconfirm"/>
			</div>
			<div class="row">
				<label for="spassword" class="joinLabel-1"><spring:message code="join.form.spassword"/></label>
				<form:select path="spassword" >
						<form:option value="1">내가 다닌 초등학교 이름은?</form:option>
						<form:option value="2">어머님 성함은?</form:option>
						<form:option value="3">가장 좋아하는 색은?</form:option>
				</form:select>
				<form:errors path="spassword"/>
			</div>
			<div class="row">
					<label for="apassword" class="joinLabel-1"><spring:message code="join.form.apassword"/></label>
					<form:input path="apassword" class="joinInput-1"/>
					<form:errors path="apassword"/>
			</div>
			<div class="row">		
					<label for="email" class="joinLabel-1"><spring:message code="join.form.email"/></label>
					<form:input path="email1" size="12"/> @
					<form:select path="email2">
						<form:option value="naver.com">naver.com</form:option>
						<form:option value="daum.net">daum.net</form:option>
						<form:option value="nate.com">nate.com</form:option>
					</form:select>
					<form:errors path="email1"/>
			</div>
			<div class="row">
					<label for="phone" class="joinLabel-1"><spring:message code="join.form.phone"/></label>
					<form:select path="phone1">
						<form:option value="010">010</form:option>
						<form:option value="011">011</form:option>
						<form:option value="016">016</form:option>
						<form:option value="017">017</form:option>
						<form:option value="018">018</form:option>
						<form:option value="019">019</form:option>
					</form:select>-
					<form:input path="phone2" maxlength="4" size="5"/>-<form:input path="phone3" maxlength="4" size="5"/>
					<form:errors path="phone2"/>
			</div>
			<div class="row" >
					<label for="birth" class="joinLabel-1"><spring:message code="join.form.birth"/></label>
				
					<form:select path="birth1">
						<form:option value="1">선택하세요.</form:option>
						<form:option value="1950">1950 이전</form:option>
						<c:forEach var="i" begin="1950" end="1995">					
							<form:option value="${i}">${i}</form:option>
						</c:forEach>	
					</form:select>년
					<form:input path="birth2" maxlength="4" size="5"/>월 <form:input path="birth3" maxlength="4" size="5"/>일
					<%-- <form:select path="birth2">
						<form:option value="unchecked">선택하세요.</form:option>
						<form:option value="1">1</form:option>
						<form:option value="2">2</form:option>
						<form:option value="3">3</form:option>
						<form:option value="4">4</form:option>
						<form:option value="5">5</form:option>
						<form:option value="6">6</form:option>
						<form:option value="7">7</form:option>
						<form:option value="8">8</form:option>
						<form:option value="9">9</form:option>
						<form:option value="10">10</form:option>
						<form:option value="11">11</form:option>
						<form:option value="12">12</form:option>
					</form:select>
					<form:select path="birth3">
						<form:option value="unchecked">선택하세요.</form:option>
						<form:option value="1">1</form:option>
						<form:option value="2">2</form:option>
						<form:option value="3">3</form:option>
						<form:option value="4">4</form:option>
						<form:option value="5">5</form:option>
						<form:option value="6">6</form:option>
						<form:option value="7">7</form:option>
						<form:option value="8">8</form:option>
						<form:option value="9">9</form:option>
						<form:option value="10">10</form:option>
						<form:option value="11">11</form:option>
						<form:option value="12">12</form:option>
						<form:option value="13">13</form:option>
						<form:option value="14">14</form:option>
						<form:option value="15">15</form:option>
						<form:option value="16">16</form:option>
						<form:option value="17">17</form:option>
						<form:option value="18">18</form:option>
						<form:option value="19">19</form:option>
						<form:option value="20">20</form:option>
						<form:option value="21">21</form:option>
						<form:option value="22">22</form:option>
						<form:option value="23">23</form:option>
						<form:option value="24">24</form:option>
						<form:option value="25">25</form:option>
						<form:option value="26">26</form:option>
						<form:option value="27">27</form:option>
						<form:option value="28">28</form:option>
						<form:option value="29">29</form:option>
						<form:option value="30">30</form:option>
						<form:option value="31">31</form:option>
					</form:select> --%>
					<form:errors path="birth3"/>
				</div>
				<div class="row">
				<label for="sex" class="joinLabel-1"><spring:message code="join.form.sex"/></label>
				
					<form:radiobutton path="sex" label="남" value="1"/>
					<form:radiobutton path="sex" label="여" value="2"/>
					<form:errors path="sex"/>
				</div>
	</div>
	</div>
	
	<div style="margin:30px 0;">
		<h4 class="joinTxt-1">부가 프로필 입력(선택사항)</h4>
		<div class="joinWrap" >
			<div class="row">
			 <label for="region"  class="joinLabel-1"><spring:message code="join.form.region"/></label>
		<form:select path="region">
						<form:option value="1">서울</form:option>
						<form:option value="2">인천</form:option>
						<form:option value="3">대전</form:option>
						<form:option value="4">광주</form:option>
						<form:option value="5">대구</form:option>
						<form:option value="6">울산</form:option>
						<form:option value="7">부산</form:option>
						<form:option value="8">경기</form:option>
						<form:option value="9">강원</form:option>
						<form:option value="10">충북</form:option>
						<form:option value="11">충남</form:option>
						<form:option value="12">전북</form:option>
						<form:option value="13">전남</form:option>
						<form:option value="14">경북</form:option>
						<form:option value="15">경남</form:option>
						<form:option value="16">제주</form:option>
					</form:select>
					</div>
					<div class="row">
					<label for="religion" class="joinLabel-1"><spring:message code="join.form.religion"/></label>
					<form:select path="religion">
						<form:option value="1">기독교</form:option>
						<form:option value="2">천주교</form:option>
						<form:option value="3">불교</form:option>
						<form:option value="4">기타</form:option>
					</form:select>
					</div>
					<div class="row">
					<label for="acaability" class="joinLabel-1"><spring:message code="join.form.acaability"/></label>
					<form:select path="acaability">
						<form:option value="1">초등학교 졸업</form:option>
						<form:option value="2">중학교 졸업</form:option>
						<form:option value="3">고등학교 졸업</form:option>
						<form:option value="4">전문대 졸업</form:option>
						<form:option value="5">대학교 졸업 이상</form:option>
					</form:select>
					</div>
					<div class="row">
					<label for="job" class="joinLabel-1"><spring:message code="join.form.job"/></label>
					<form:select path="job">
						<form:option value="1">공무원</form:option>
						<form:option value="2">회사원</form:option>
						<form:option value="3">전문직</form:option>
						<form:option value="4">자영업</form:option>
						<form:option value="5">기타</form:option>
					</form:select>
					</div>	
					<div class="row">
					<label for="salary" class="joinLabel-1"><spring:message code="join.form.salary"/></label>
					<form:input path="salary" size="8" maxlength="6"/>만원				
					</div>
					<div class="row">
					<label for="height" class="joinLabel-1"><spring:message code="join.form.height"/></label>
					<form:select path="height">
						<c:forEach var="i" begin="150" end="190">
							<form:option value="${i}">${i}cm</form:option>
						</c:forEach>
					</form:select>
					</div>
					<div class="row">
						<label for="weight" class="joinLabel-1"><spring:message code="join.form.weight"/></label>
					<form:select path="weight">
						<c:forEach var="i" begin="40" end="90">
							<form:option value="${i}">${i}kg</form:option>
						</c:forEach>
					</form:select>
					</div>
					<div class="row">
					<label for="bloodtype"  class="joinLabel-1"><spring:message code="join.form.bloodtype"/></label>
					<form:select path="bloodtype">
						<form:option value="A">A형</form:option>
						<form:option value="B">B형</form:option>
						<form:option value="AB">AB형</form:option>
						<form:option value="O">O형</form:option>
					</form:select>
					</div>
					<div class="row">
						<label for="exmarry"  class="joinLabel-1"><spring:message code="join.form.exmarry"/></label>
					<form:radiobutton path="exmarry" label="초혼" value="1"/>
					<form:radiobutton path="exmarry" label="재혼" value="2"/>
					</div>
					<div class="row">
					<label for="upload" class="joinLabel-1"><spring:message code="join.form.upload"/></label>
					<input type="file" name="upload" id="upload"><br>
					</div>
					</div>
					</div>
					<div style="text-align:center">
						<input type="submit" value="<spring:message code="write.form.join"/>" id="btn_submit" class="btn_submit" >
						<a href="<%=contextPath%>/main/index.do" class="btn_cancel2">취소</a>
					</div>
	</fieldset>
</div>
</form:form>
	
</div>


</div>
</div>
</div>
